package com.es.disped.dao.oj.mapper;

import com.es.disped.dao.oj.model.Solution;
import com.es.disped.dao.oj.model.SolutionExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface SolutionMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=SolutionSqlProvider.class, method="countByExample")
    long countByExample(SolutionExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @DeleteProvider(type=SolutionSqlProvider.class, method="deleteByExample")
    int deleteByExample(SolutionExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Delete({
        "delete from solution",
        "where solution_id = #{solutionId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer solutionId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Insert({
        "insert into solution (solution_id, problem_id, ",
        "user_id, time, memory, ",
        "in_date, result, ",
        "language, ip, contest_id, ",
        "valid, num, code_length, ",
        "judgetime, pass_rate, ",
        "lint_error, judger)",
        "values (#{solutionId,jdbcType=INTEGER}, #{problemId,jdbcType=INTEGER}, ",
        "#{userId,jdbcType=CHAR}, #{time,jdbcType=INTEGER}, #{memory,jdbcType=INTEGER}, ",
        "#{inDate,jdbcType=TIMESTAMP}, #{result,jdbcType=SMALLINT}, ",
        "#{language,jdbcType=INTEGER}, #{ip,jdbcType=CHAR}, #{contestId,jdbcType=INTEGER}, ",
        "#{valid,jdbcType=TINYINT}, #{num,jdbcType=TINYINT}, #{codeLength,jdbcType=INTEGER}, ",
        "#{judgetime,jdbcType=TIMESTAMP}, #{passRate,jdbcType=DECIMAL}, ",
        "#{lintError,jdbcType=INTEGER}, #{judger,jdbcType=CHAR})"
    })
    int insert(Solution record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @InsertProvider(type=SolutionSqlProvider.class, method="insertSelective")
    int insertSelective(Solution record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=SolutionSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="solution_id", property="solutionId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="problem_id", property="problemId", jdbcType=JdbcType.INTEGER),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR),
        @Result(column="time", property="time", jdbcType=JdbcType.INTEGER),
        @Result(column="memory", property="memory", jdbcType=JdbcType.INTEGER),
        @Result(column="in_date", property="inDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="result", property="result", jdbcType=JdbcType.SMALLINT),
        @Result(column="language", property="language", jdbcType=JdbcType.INTEGER),
        @Result(column="ip", property="ip", jdbcType=JdbcType.CHAR),
        @Result(column="contest_id", property="contestId", jdbcType=JdbcType.INTEGER),
        @Result(column="valid", property="valid", jdbcType=JdbcType.TINYINT),
        @Result(column="num", property="num", jdbcType=JdbcType.TINYINT),
        @Result(column="code_length", property="codeLength", jdbcType=JdbcType.INTEGER),
        @Result(column="judgetime", property="judgetime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="pass_rate", property="passRate", jdbcType=JdbcType.DECIMAL),
        @Result(column="lint_error", property="lintError", jdbcType=JdbcType.INTEGER),
        @Result(column="judger", property="judger", jdbcType=JdbcType.CHAR)
    })
    List<Solution> selectByExample(SolutionExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Select({
        "select",
        "solution_id, problem_id, user_id, time, memory, in_date, result, language, ip, ",
        "contest_id, valid, num, code_length, judgetime, pass_rate, lint_error, judger",
        "from solution",
        "where solution_id = #{solutionId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="solution_id", property="solutionId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="problem_id", property="problemId", jdbcType=JdbcType.INTEGER),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR),
        @Result(column="time", property="time", jdbcType=JdbcType.INTEGER),
        @Result(column="memory", property="memory", jdbcType=JdbcType.INTEGER),
        @Result(column="in_date", property="inDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="result", property="result", jdbcType=JdbcType.SMALLINT),
        @Result(column="language", property="language", jdbcType=JdbcType.INTEGER),
        @Result(column="ip", property="ip", jdbcType=JdbcType.CHAR),
        @Result(column="contest_id", property="contestId", jdbcType=JdbcType.INTEGER),
        @Result(column="valid", property="valid", jdbcType=JdbcType.TINYINT),
        @Result(column="num", property="num", jdbcType=JdbcType.TINYINT),
        @Result(column="code_length", property="codeLength", jdbcType=JdbcType.INTEGER),
        @Result(column="judgetime", property="judgetime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="pass_rate", property="passRate", jdbcType=JdbcType.DECIMAL),
        @Result(column="lint_error", property="lintError", jdbcType=JdbcType.INTEGER),
        @Result(column="judger", property="judger", jdbcType=JdbcType.CHAR)
    })
    Solution selectByPrimaryKey(Integer solutionId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=SolutionSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Solution record, @Param("example") SolutionExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=SolutionSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Solution record, @Param("example") SolutionExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=SolutionSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Solution record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table solution
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Update({
        "update solution",
        "set problem_id = #{problemId,jdbcType=INTEGER},",
          "user_id = #{userId,jdbcType=CHAR},",
          "time = #{time,jdbcType=INTEGER},",
          "memory = #{memory,jdbcType=INTEGER},",
          "in_date = #{inDate,jdbcType=TIMESTAMP},",
          "result = #{result,jdbcType=SMALLINT},",
          "language = #{language,jdbcType=INTEGER},",
          "ip = #{ip,jdbcType=CHAR},",
          "contest_id = #{contestId,jdbcType=INTEGER},",
          "valid = #{valid,jdbcType=TINYINT},",
          "num = #{num,jdbcType=TINYINT},",
          "code_length = #{codeLength,jdbcType=INTEGER},",
          "judgetime = #{judgetime,jdbcType=TIMESTAMP},",
          "pass_rate = #{passRate,jdbcType=DECIMAL},",
          "lint_error = #{lintError,jdbcType=INTEGER},",
          "judger = #{judger,jdbcType=CHAR}",
        "where solution_id = #{solutionId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Solution record);
}